home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / results.dxr / 00028_disk title bar button.ls < prev    next >
Encoding:
Text File  |  2000-01-31  |  1.0 KB  |  34 lines

  1. property ancestor
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   return me
  10. end
  11.  
  12. on performFunction me
  13.   global gResultsClassObj, gEnvironObj
  14.   tell the stage
  15.     playSFX(5)
  16.   end tell
  17.   repeat while soundBusy(1)
  18.   end repeat
  19.   txtObj = new(xtra("fileio"))
  20.   if not objectp(txtObj) then
  21.     beep()
  22.   else
  23.     pathAndFile = displaySave(txtObj, "Save hit list as:", "Untitled")
  24.     txtObj = 0
  25.   end if
  26.   if not voidp(pathAndFile) and (pathAndFile <> EMPTY) then
  27.     fileContents = "{RESULTS}" & RETURN
  28.     put line 1 to 3 of field "criteria field" & RETURN after txtObj
  29.     put line 1 of field "hitList field" & RETURN after txtObj
  30.     put the text of field "results field" after txtObj
  31.     saveTextFile(pathAndFile, fileContents, getTypeCreator(gEnvironObj))
  32.   end if
  33. end
  34.